// axios
import request from '@/utils/request'
import qs from 'qs';

// 登录
export function login(data) {
  return request({
    url: '/task/public/login',
    method: 'post',
    headers: {
      'Content-Type':'application/x-www-form-urlencoded'
    },
    data:qs.stringify(data),
  })
}

// 用户信息 post 方法
export function getInfo(data) {
  return request({
    url: '/task/user/info',
    method: 'post',
    data,
  })
}


// 注册
export function register(data) {
  return request({
    url: '/task/public/register',
    method: 'post',
    data,
  })
}

// 退出
export function logout(data) {
  return request({
    url: '/task/public/logout',
    method: 'post',
    data
  })
}

// 修改用户信息
export function editUserInfo(data) {
  return request({
    url: '/task/user/editData',
    method: 'post',
    headers: {
      'Content-Type':'application/x-www-form-urlencoded'
    },
    data:qs.stringify(data),
  })
}



// 修改密码
export function editUserPasswd(data) {
  return request({
    url: '/task/user/editPasswd',
    method: 'post',
    headers: {
      'Content-Type':'application/x-www-form-urlencoded'
    },
    data:qs.stringify(data),
  })
}
